package com.xinli.business.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinli.common.annotation.Excel;
import com.xinli.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

/**
 * 用户评论对象 lf_comment
 *
 * @author ruoyi
 * @date 2025-04-29
 */
@Data
@TableName(value = "lf_comment")
@EqualsAndHashCode(callSuper = true)
public class LfComment extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * "父级id"
     */
    @Excel(name = "父级id")
    private Long pid;

    /**
     * "评论类型:1帖子2评论回复"
     */
    @Excel(name = "评论类型:1帖子2评论回复")
    private Long type;

    /**
     * "评论作者ID"
     */
    @Excel(name = "评论作者ID")
    private Long uid;

    /**
     * "被回复用户ID"
     */
    @Excel(name = "被回复用户ID")
    private Long toUid;

    /**
     * "评论帖子ID"
     */
    @Excel(name = "评论帖子ID")
    private Long postId;

    /**
     * "评论内容"
     */
    @Excel(name = "评论内容")
    @NotBlank(message = "评论内容不能为空")
    @Size(min = 0, max = 200, message = "评论内容长度不能超过200个字符")
    private String content;

    /**
     * "评论状态"
     */
    @Excel(name = "评论状态")
    private Long status;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT) // 新增执行
    private Date createTime;


    /**
     * "用户姓名"
     */
    @TableField(exist = false)
    private String  username;

    /**
     * "用户头像"
     */
    @TableField(exist = false)
    private String  useravatar;


    /**
     * "被回复用户姓名"
     */
    @TableField(exist = false)
    private String  toUsername;


    /**
     * "被回复用户头像"
     */
    @TableField(exist = false)
    private String  toUseravatar;


    /**
     * "评论数量"
     */
    @Excel(name = "评论数量")
    private Long plCount;


    /**
     * "点赞数量"
     */
    @Excel(name = "点赞数量")
    private Long dzCount;


    /**
     * "是否点赞  true  false"
     */
    @Excel(name = "是否点赞")
    private Boolean isDz;


    @TableField(exist = false)
    private List<LfComment> replyList;


    /**
     * "是否关注  true  false"
     */
    @TableField(exist = false)
    @Excel(name = "是否关注")
    private Boolean isFollow;



}
